﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CollectionsJoin
{
    public static class CollectionsExtensions
    {
        public static string Join<T>(this ICollection<T> collection)
        {
            StringBuilder joiner = new StringBuilder();
            joiner.Append("[");
            foreach (T item in collection)
            {
                joiner.Append(item + ",");
            }
            joiner.Remove(joiner.Length - 1, 1);
            joiner.Append("]");

            return joiner.ToString();
        }
    }
}
